


import 'package:ysy_flutter_mvvm_yuanxuan/bean/base/BaseBean.dart';

class GoodsDetailsBean extends BaseJsonBean{
  Product? product;
  List<ProductAttributeValueList>? productAttributeValueList;
  List<SkuStockList>? skuStockList;
  List<ProductSpecList>? productSpecList;
  PmsCommentResult? pmsCommentResult;
  String? rate;
  int? isCollection;
  SellerDescribed? sellerDescribed;
  String? likenumInt;
  String? productCollect;
  int? isLike;
  List<RecommendList>? similarityList;
  List<RecommendList>? recommendList;
  String? shareUrl;
  TsysStoreInfo? tsysStoreInfo;

  GoodsDetailsBean(
      {this.product,
        this.productAttributeValueList,
        this.skuStockList,
        this.productSpecList,
        this.pmsCommentResult,
        this.rate,
        this.isCollection,
        this.sellerDescribed,
        this.likenumInt,
        this.productCollect,
        this.isLike,
        this.similarityList,
        this.recommendList,
        this.shareUrl,
        this.tsysStoreInfo});

  GoodsDetailsBean.fromJson(Map<String, dynamic> json) {
    product =
    json['product'] != null ? new Product.fromJson(json['product']) : null;
    if (json['productAttributeValueList'] != null) {
      productAttributeValueList = [];
      json['productAttributeValueList'].forEach((v) {
        productAttributeValueList?.add(new ProductAttributeValueList.fromJson(v));
      });
    }
    if (json['skuStockList'] != null) {
      skuStockList = [];
      json['skuStockList'].forEach((v) {
        skuStockList?.add(new SkuStockList.fromJson(v));
      });
    }
    if (json['productSpecList'] != null) {
      productSpecList = [];
      json['productSpecList'].forEach((v) {
        productSpecList?.add(new ProductSpecList.fromJson(v));
      });
    }
    pmsCommentResult = json['pmsCommentResult'] != null
        ? new PmsCommentResult.fromJson(json['pmsCommentResult'])
        : null;
    rate = json['rate'];
    isCollection = json['isCollection'];
    sellerDescribed = json['sellerDescribed'] != null
        ? new SellerDescribed.fromJson(json['sellerDescribed'])
        : null;
    likenumInt = json['likenumInt'];
    productCollect = json['productCollect'];
    isLike = json['isLike'];
    if (json['similarityList'] != null) {
      similarityList = [];
      json['similarityList'].forEach((v) {
        similarityList?.add(new RecommendList.fromJson(v));
      });
    }
    if (json['recommendList'] != null) {
      recommendList = [];
      json['recommendList'].forEach((v) {
        recommendList?.add(new RecommendList.fromJson(v));
      });
    }
    shareUrl = json['shareUrl'];
    tsysStoreInfo = json['tsysStoreInfo'] != null
        ? new TsysStoreInfo.fromJson(json['tsysStoreInfo'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.product != null) {
      data['product'] = this.product?.toJson();
    }
    if (this.productAttributeValueList != null) {
      data['productAttributeValueList'] =
          this.productAttributeValueList?.map((v) => v.toJson()).toList();
    }
    if (this.skuStockList != null) {
      data['skuStockList'] = this.skuStockList?.map((v) => v.toJson()).toList();
    }
    if (this.productSpecList != null) {
      data['productSpecList'] =
          this.productSpecList?.map((v) => v.toJson()).toList();
    }
    if (this.pmsCommentResult != null) {
      data['pmsCommentResult'] = this.pmsCommentResult?.toJson();
    }
    data['rate'] = this.rate;
    data['isCollection'] = this.isCollection;
    if (this.sellerDescribed != null) {
      data['sellerDescribed'] = this.sellerDescribed?.toJson();
    }
    data['likenumInt'] = this.likenumInt;
    data['productCollect'] = this.productCollect;
    data['isLike'] = this.isLike;
    if (this.similarityList != null) {
      data['similarityList'] =
          this.similarityList?.map((v) => v.toJson()).toList();
    }
    if (this.recommendList != null) {
      data['recommendList'] =
          this.recommendList?.map((v) => v.toJson()).toList();
    }
    data['shareUrl'] = this.shareUrl;
    if (this.tsysStoreInfo != null) {
      data['tsysStoreInfo'] = this.tsysStoreInfo?.toJson();
    }
    return data;
  }
}

class Product {
  String?  askPrice;
  String?  productId;
  int?  productType;
  String?  labelName;
  String?  labelDescription;
  String?  storeId;
  int?  productCategoryId;
  int?  storeProductCategoryId;
  int?  productAttributeCategoryId;
  String?  name;
  String?  pic;
  String?  productSn;
  int?  sale;
  double?  price;
  String?  unit;
  double?  weight;
  String?  albumPics;
  String?  productCategoryName;
  int?  moqSample;
  String?  crtTime;
  String?  remark;
  int?  isAskPriceFlag;

  Product(
      {this.askPrice,
        this.productId,
        this.productType,
        this.labelName,
        this.labelDescription,
        this.storeId,
        this.productCategoryId,
        this.storeProductCategoryId,
        this.productAttributeCategoryId,
        this.name,
        this.pic,
        this.productSn,
        this.sale,
        this.price,
        this.unit,
        this.weight,
        this.albumPics,
        this.productCategoryName,
        this.moqSample,
        this.crtTime,
        this.remark,
        this.isAskPriceFlag});

  Product.fromJson(Map<String, dynamic> json) {
    askPrice = json['askPrice'];
    productId = json['productId'];
    productType = json['productType'];
    labelName = json['labelName'];
    labelDescription = json['labelDescription'];
    storeId = json['storeId'];
    productCategoryId = json['productCategoryId'];
    storeProductCategoryId = json['storeProductCategoryId'];
    productAttributeCategoryId = json['productAttributeCategoryId'];
    name = json['name'];
    pic = json['pic'];
    productSn = json['productSn'];
    sale = json['sale'];
    price = (json['price'] as num?)?.toDouble();
    unit = json['unit'];
    weight = (json['weight']as num?)?.toDouble();
    albumPics = json['albumPics'];
    productCategoryName = json['productCategoryName'];
    moqSample = json['moqSample'];
    crtTime = json['crtTime'];
    remark = json['remark'];
    isAskPriceFlag = json['isAskPriceFlag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['askPrice'] = this.askPrice;
    data['productId'] = this.productId;
    data['productType'] = this.productType;
    data['labelName'] = this.labelName;
    data['labelDescription'] = this.labelDescription;
    data['storeId'] = this.storeId;
    data['productCategoryId'] = this.productCategoryId;
    data['storeProductCategoryId'] = this.storeProductCategoryId;
    data['productAttributeCategoryId'] = this.productAttributeCategoryId;
    data['name'] = this.name;
    data['pic'] = this.pic;
    data['productSn'] = this.productSn;
    data['sale'] = this.sale;
    data['price'] = this.price;
    data['unit'] = this.unit;
    data['weight'] = this.weight;
    data['albumPics'] = this.albumPics;
    data['productCategoryName'] = this.productCategoryName;
    data['moqSample'] = this.moqSample;
    data['crtTime'] = this.crtTime;
    data['remark'] = this.remark;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    return data;
  }
}

class ProductAttributeValueList {
  int?  id;
  String?  productId;
  int?  productAttributeId;
  String?  value;
  String?  name;

  ProductAttributeValueList(
      {this.id,
        this.productId,
        this.productAttributeId,
        this.value,
        this.name});

  ProductAttributeValueList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    productId = json['productId'];
    productAttributeId = json['productAttributeId'];
    value = json['value'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['productId'] = this.productId;
    data['productAttributeId'] = this.productAttributeId;
    data['value'] = this.value;
    data['name'] = this.name;
    return data;
  }
}

class SkuStockList {
  int?  id;
  String?  skuId;
  String?  productId;
  String?  skuCode;
  double?  price;
  int?  stock;
  int?  lowStock;
  String?  pic;
  int?  lockStock;
  String?  spData;
  int?  isSample;
  double?  samplePrice;
  int?  isOrder;
  double?  orderPrice;
  int?  isAskPriceFlag;

  SkuStockList(
      {this.id,
        this.skuId,
        this.productId,
        this.skuCode,
        this.price,
        this.stock,
        this.lowStock,
        this.pic,
        this.lockStock,
        this.spData,
        this.isSample,
        this.samplePrice,
        this.isOrder,
        this.orderPrice,
        this.isAskPriceFlag});

  SkuStockList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    skuId = json['skuId'];
    productId = json['productId'];
    skuCode = json['skuCode'];
    price = json['price'];
    stock = json['stock'];
    lowStock = json['lowStock'];
    pic = json['pic'];
    lockStock = json['lockStock'];
    spData = json['spData'];
    isSample = json['isSample'];
    samplePrice = (json['samplePrice'] as num?)?.toDouble();;
    isOrder = json['isOrder'];
    orderPrice = (json['orderPrice']  as num?)?.toDouble();
    isAskPriceFlag = json['isAskPriceFlag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['skuId'] = this.skuId;
    data['productId'] = this.productId;
    data['skuCode'] = this.skuCode;
    data['price'] = this.price;
    data['stock'] = this.stock;
    data['lowStock'] = this.lowStock;
    data['pic'] = this.pic;
    data['lockStock'] = this.lockStock;
    data['spData'] = this.spData;
    data['isSample'] = this.isSample;
    data['samplePrice'] = this.samplePrice;
    data['isOrder'] = this.isOrder;
    data['orderPrice'] = this.orderPrice;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    return data;
  }
}

class ProductSpecList {
  int?  id;
  String?  productId;
  String?  name;
  String?  inputList;
  List<String>? inputLists;

  ProductSpecList(
      {this.id, this.productId, this.name, this.inputList, this.inputLists});

  ProductSpecList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    productId = json['productId'];
    name = json['name'];
    inputList = json['inputList'];
    inputLists = json['inputLists'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['productId'] = this.productId;
    data['name'] = this.name;
    data['inputList'] = this.inputList;
    data['inputLists'] = this.inputLists;
    return data;
  }
}

class PmsCommentResult {
  // List<Null> pmsComments;
  String? totalNum;

  PmsCommentResult({this.totalNum});

  PmsCommentResult.fromJson(Map<String, dynamic> json) {
    totalNum = json['totalNum'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['totalNum'] = this.totalNum;
    return data;
  }
}

class SellerDescribed {
  String?  deliveryCycle;
  String?  specification;
  String?  shipment;

  SellerDescribed({this.deliveryCycle, this.specification, this.shipment});

  SellerDescribed.fromJson(Map<String, dynamic> json) {
    deliveryCycle = json['deliveryCycle'];
    specification = json['specification'];
    shipment = json['shipment'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['deliveryCycle'] = this.deliveryCycle;
    data['specification'] = this.specification;
    data['shipment'] = this.shipment;
    return data;
  }
}

class RecommendList {
  String?  productId;
  String?  name;
  String?  pic;
  int?  sale;
  int?  isAskPriceFlag;
  String?  unit;
  double?  price;
  int?  newStatus;

  RecommendList(
      {this.productId,
        this.name,
        this.pic,
        this.sale,
        this.isAskPriceFlag,
        this.unit,
        this.price,
        this.newStatus});

  RecommendList.fromJson(Map<String, dynamic> json) {
    productId = json['productId'];
    name = json['name'];
    pic = json['pic'];
    sale = json['sale'];
    isAskPriceFlag = json['isAskPriceFlag'];
    unit = json['unit'];
    price = (json['price'] as num?)?.toDouble();
    newStatus = json['newStatus'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['productId'] = this.productId;
    data['name'] = this.name;
    data['pic'] = this.pic;
    data['sale'] = this.sale;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    data['unit'] = this.unit;
    data['price'] = this.price;
    data['newStatus'] = this.newStatus;
    return data;
  }
}

class TsysStoreInfo {
  int?  id;
  String?  storeId;
  String?  corpId;
  String?  storeName;
  String?  logoPath;
  String?  enabledSt;
  String?  storeAddr;
  int?  followCount;
  int?  productCount;
  List<Products>? products;

  TsysStoreInfo(
      {this.id,
        this.storeId,
        this.corpId,
        this.storeName,
        this.logoPath,
        this.enabledSt,
        this.storeAddr,
        this.followCount,
        this.productCount,
        this.products});

  TsysStoreInfo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    storeId = json['storeId'];
    corpId = json['corpId'];
    storeName = json['storeName'];
    logoPath = json['logoPath'];
    enabledSt = json['enabledSt'];
    storeAddr = json['storeAddr'];
    followCount = json['followCount'];
    productCount = json['productCount'];
    if (json['products'] != null) {
      products = [];
      json['products'].forEach((v) {
        products?.add(new Products.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['storeId'] = this.storeId;
    data['corpId'] = this.corpId;
    data['storeName'] = this.storeName;
    data['logoPath'] = this.logoPath;
    data['enabledSt'] = this.enabledSt;
    data['storeAddr'] = this.storeAddr;
    data['followCount'] = this.followCount;
    data['productCount'] = this.productCount;
    if (this.products != null) {
      data['products'] = this.products?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Products {
  int?  id;
  String?  productId;
  String?  name;
  String?  pic;
  int?  newStatus;
  int?  recommandStatus;
  int?  sale;
  double?  price;
  String?  subTitle;

  Products(
      {this.id,
        this.productId,
        this.name,
        this.pic,
        this.newStatus,
        this.recommandStatus,
        this.sale,
        this.price,
        this.subTitle});

  Products.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    productId = json['productId'];
    name = json['name'];
    pic = json['pic'];
    newStatus = json['newStatus'];
    recommandStatus = json['recommandStatus'];
    sale = json['sale'];
    price = (json['price'] as num?)?.toDouble();
    subTitle = json['subTitle'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['productId'] = this.productId;
    data['name'] = this.name;
    data['pic'] = this.pic;
    data['newStatus'] = this.newStatus;
    data['recommandStatus'] = this.recommandStatus;
    data['sale'] = this.sale;
    data['price'] = this.price;
    data['subTitle'] = this.subTitle;
    return data;
  }
}
